home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-28 | 1.6 KB | 76 lines | [TEXT/MPS ] |
- /*
- File: CQueueEnumerator.cp
-
- Contains: xxx put contents here xxx
-
- Written by: Tim Harnett
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 9/22/94 TMH made this from stuff in TMSAMSlot::GetIncomingLetter
- <1> 9/22/94 TMH made this from stuff in TMSAMSlot::GetIncomingLetter
- 9/22/94 TMH xxx put comment here xxx
-
- To Do:
- */
-
- #ifndef __CQueueEnumerator__
- #include "CQueueEnumerator.h"
- #endif
-
- #ifndef __THREADS__
- #include "Threads.h"
- #endif
-
-
- //---------------------------------
- // C O u t Q E n u m e r a t o r
- //---------------------------------
-
- //-----------------------------------------------------------------------------------
- COutQEnumerator::COutQEnumerator(MSAMQueueRef qRef)
- {
- fPB.ioCompletion = 0;
- fPB.queueRef = qRef;
- fPB.buffer.bufferSize = sizeof(EnumOutQReply);
- fPB.buffer.buffer = (Ptr)&fEnumBlock;
- }
-
-
- //-----------------------------------------------------------------------------------
- MSAMEnumerateOutQReply* COutQEnumerator::FirstLetter()
- {
- fPB.startSeqNum = 1;
- this->Enumerate();
- return &fEnumBlock.outQEnumReply;
-
- }
-
-
- //-----------------------------------------------------------------------------------
- MSAMEnumerateOutQReply* COutQEnumerator::NextLetter()
- {
- fPB.startSeqNum = fPB.nextSeqNum;
- if( this->More() ) {
- this->Enumerate();
- return &fEnumBlock.outQEnumReply;
- } else
- return 0;
-
-
-
- }
-
- //-----------------------------------------------------------------------------------
- void COutQEnumerator::Enumerate()
- {
- MSAMEnumerate((MSAMParam *)&fPB,true);
- do {
- YieldToAnyThread();
- } while( fPB.ioResult > 0 );
-
- }
-
-